<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta name="description" content="AWStats Documentation - Contrib and resource page">
<meta name="keywords" content="awstats, awstat, log, file, analyzer, contrib, plugins, resources, maxmind, geoipfree, geoip, cities, regions, countries, frontend">
<meta name="robots" content="index,follow">
<meta name="title" content="AWStats Documentation - Plugins Development - Graphs"><title>AWStats Documentation - Plugins Development - Graphs</title>

<link rel="stylesheet" href="styles.css" type="text/css">
<link href="scripts/prettify.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="scripts/prettify.js"></script><!-- $Revision: 1.2 $ - $Author: eldy $ - $Date: 2010/06/22 21:35:24 $ -->
</head>
<body onload="prettyPrint()">
<table style="font-family: arial,helvetica,verdana; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- Large -->
<tbody>
<tr style="font-family: arial,helvetica,verdana; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<td align="center" bgcolor="#9999cc"><a href="/"><img src="images/awstats_logo1.png" border="0"></a></td>
<td align="center" bgcolor="#9999cc">
<br>
<font style="font-family: arial,helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16pt; line-height: normal; font-size-adjust: none; font-stretch: normal;" color="#eeeeff"><b>AWStats logfile analyzer 7.0
Documentation</b></font><br>
<br>
</td>
<td align="center" bgcolor="#9999cc">
&nbsp;
</td>
</tr>
</tbody>
</table>
<br>
<br>
<h1 style="font-family: arial,helvetica,sanserif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 26px; line-height: normal; font-size-adjust: none; font-stretch: normal;">Plugin
Graphs</h1>
Charts, graphs and maps can be generated by your plugin and make
AWStats reports look nice. AWStats generates arrays of values, label
names and titles so that your plugin only has to handle the final data
and display it as you wish.<br>
<span style="font-weight: bold;">NOTE:</span> Only
one graphing plugin should be choose by a user at any given time, thus
your plugin should generate as many graphs as possible. If more than
one graphing plugin is enabled at any given time, multiple graphs will
appear in the output for each graph type.<br>
<br>
Below is a list of variables passed to the graphin hook and how you
should use them.<br>
<ul>
<li>Title</li>
<li>Type</li>
<li>Block Label</li>
<li>Val Label</li>
<li>Val Color</li>
<li>Val Max</li>
<li>Val Total</li>
<li>Val Average</li>
<li>Val Data</li>
</ul>
<br>
<font color="#665544" size="3"><b>Title</b></font><br>
<hr>This is simply the title of the graph as it should be
displayed to the end user. This could be "Hosts (Top 5)" or "Monthly
History" or anything else. Of course, you don't have to show the title
unless you want to.<br>
<br>
<font color="#665544" size="3"><b>Type</b></font><br>
<hr>The type is important as your graphing plugin should
determine what type of graph to output depending on the type AWStats is
requesting. For information on types and the data order, <a href="#Graph_Types_and_Data">check the Types and Data section</a>.<br>
<ul>
</ul>
<font color="#665544" size="3"><b>Block Label</b></font><br>
<hr>This is a label for each group of data, usually labels for
the X axis such as the days of the week, months of the year, etc. Your
plugin can use the scalar count of values in this array as the number
of times a loop needs to iterate through an axis. For example:<br>
<br>
<code class="prettyprint">foreach my $j (1.. (scalar
@$blocklabel)) { ... }</code><br>
<br>
<font color="#665544" size="3"><b>Val Label</b></font><br>
<hr>@vallabel contains a list of labels for each of the data sets
such as "pages", "hits", etc. Use the scalar count of values when
accessing the data matrix.<br>
<br>
<font color="#665544" size="3"><b>Val Color</b></font><br>
<hr>This is an array of color values associated with each type of
data as assigned by the configuration file or the defaults in AWStats.
Each color is a web formatted RGB hex encoded value such as "FFFFFF" or
"000000". <br>
<br>
<font color="#665544" size="3"><b>Val Max</b></font><br>
<hr>This array contains the maximum individual numeric value for
each of the types of data stored in the data array. The count is the
same as the the color array.<br>
<br>
<font color="#665544" size="3"><b>Val Total</b></font><br>
<hr>This array contains the total numeric value for each type of
data stored in the data array.&nbsp;The count is the same as the
the color array. <br>
<br>
<font color="#665544" size="3"><b>Val Average</b></font><br>
<hr>This array contains the average numeric value for each type
of data
stored in the data array.&nbsp;The count is the same as the the
color array. <br>
<br>
<font color="#665544" size="3"><b>Val Data</b></font><br>
<hr>This array contains the actual data values for each type of
data indexed by each data type for a block of data, then the next set
of types for a block and so on. Thus if we were looking at the monthly
graph, the data would be laid out thusly:<br>
<br>
$valdata[0] --&gt; January Unique Visitors<br>
$valdata[1] --&gt; January Number of Visits<br>
$valdata[2] --&gt; January Pages<br>
$valdata[3] --&gt; January Hits<br>
$valdata[4] --&gt; January Bandwidth<br>
$valdata[5] --&gt; February Unique Visitors<br>
$valdata[6] --&gt; February Number of Visits<br>
....<br>
<br>
<font color="#665544" size="3"><b><a name="Graph_Types_and_Data"></a>Graph Types and Data</b></font><br>
<hr>Below is a list of the different graph types and the order in
which data appears in the associated arrays.<br>
<br>
<ul>
<li><span style="font-weight: bold;">month</span>
- a graph of each month for a given year</li>
<ul>
<li>Unique Visitors</li>
<li>Visits</li>
<li>Pages</li>
<li>Hits</li>
<li>Bandwidth</li>
</ul>
<li><span style="font-weight: bold;">daysofmonth</span>
- each day of the month</li>
<ul>
<li>Visits</li>
<li>Pages</li>
<li>Hits</li>
<li>Bandwidth</li>
</ul>
<li><span style="font-weight: bold;">daysofweek</span>
-&nbsp;an averaged data set for each day of the week</li>
<ul>
<li>Pages</li>
<li>Hits</li>
<li>Bandwidth</li>
</ul>
<li><span style="font-weight: bold;">hours</span>
- an averaged data set for each hour of a day</li>
<ul>
<li>Pages</li>
<li>Hits</li>
<li>Bandwidth</li>
</ul>
<li><span style="font-weight: bold;">cluster</span>
- the top 5 clustered servers if the cluster option is enabled</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">filetypes</span>
- the top 5 file types reported on</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">httpstatus</span>
- the top 5 HTTP status codes</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">browsers</span>
- the top 5 browsers</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">oss</span>
- the top 5 operating systems</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">hosts</span>
- the top 5 hosts</li>
<ul>
<li>Pages</li>
</ul>
<li><span style="font-weight: bold;">countries_map</span>
- a list of all countries and their hit counts</li>
<ul>
<li>Hits</li>
</ul>
</ul>
<br>
<hr>
<script language="javascript">
var date='$Date: 2010/06/22 21:35:24 $';
document.writeln("Last revision: "+date);
</script><!--
First version of this tool was designed to analyze folowing web sites:
-->
</body></html>